package com.zhentao.controller;

import com.zhentao.model.common.business.pojo.BusinessGood;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.BusinessGoodService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/good")
public class BusinessGoodController {
    @Resource
    BusinessGoodService businessGoodService;

    /**
     * 查询所有商品
     * @return
     */
    @GetMapping("/list")
    public ResponseResult listGood() {
        return businessGoodService.listGood();
    }

    /**
     * 新增商品
     * @param businessGood
     * @return
     */
    @PostMapping("/add")
    public ResponseResult addGood(BusinessGood businessGood) {
        return businessGoodService.addGood(businessGood);
    }


}
